<?php
	require("model.php");
	if( $_SERVER['REQUEST_METHOD'] == "POST"){
		insert_comment($_POST);	//mang post chua cac thong tin gui len tu form
		
		echo "<script language='javascript'>window.location = 'controller.php?news_id=". $_POST['news_id']. "';</script>";
	} 
	else{
		$news = get_news($_GET['news_id']);
		$news_id = $news['news_id'];
		$comments = get_comments($_GET['news_id']);
		require('view.php');
	}
?>